<%--
  Created by IntelliJ IDEA.
  User: lxm
  Date: 2018/2/24
  Time: 下午8:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<div class="layui-tab layui-tab-brief" lay-filter="">
    <ul class="layui-tab-title">
        <li class="layui-this">模型训练</li>
        <li>贝叶斯分类</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <div class="bayes">
                <form class="layui-form layui-form-pane form_bayes" action="">
                    <div class="layui-form-item div_bayes_text">

                        <label class="layui-form-label">类别名</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" name="typeName" lay-verify="required" placeholder="必需"
                                   autocomplete="off" class="layui-input">
                        </div>

                        <label class="layui-form-label">训练语料</label>
                        <div class="layui-input-inline" style="width: 49%">
                            <input type="text" name="SIMILAR_TEXT" lay-verify="title"
                                   autocomplete="off"
                                   placeholder="以【 ||| 】分割每份语料"
                                   class="layui-input"/>
                        </div>
                        <div class="layui-input-inline" style="width: 120px">
                            <div class="layui-btn-group">
                                <button type='button' id="btn_add_onlyone"
                                        class="layui-btn layui-btn"
                                        onclick='addBayesInput("form_bayes")'>
                                    <i class="layui-icon">&#xe654;</i>
                                </button>
                                <button type='button' id="btn_delete_onlyone"
                                        class="layui-btn layui-btn-warm layui-btn"
                                        onclick='deleteBayesInput("form_bayes",$(this))'>
                                    <i class="layui-icon">&#xe640;</i>
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <button class="layui-btn layui-btn-fluid" style="width: 96.5%;" onclick="handonBayesData()">
                提交语料
            </button>
            <fieldset class="layui-elem-field layui-field-title">
                <legend>训练结果</legend>
                <div id="bayes_res_md5" class="layui-field-box">

                </div>
            </fieldset>

            <fieldset class="layui-elem-field layui-field-title">
                <legend>结果说明</legend>
                <div class="layui-field-box">
                    <blockquote class="layui-elem-quote layui-quote-nm"><p class="gray-p">
                        训练结果为一串MD5的字符串，作为模型的Tag，模型已在本地持久化，在预测分类时，只需要输入模型Tag，后台会自动对该模型反序列化并加载。</p>
                    </blockquote>

                </div>
            </fieldset>


        </div>
        <div class="layui-tab-item">
            <blockquote class="layui-elem-quote layui-text">
                您可以输入模型Tag值，并尝试使用Bayes的API接口。本模块支持多文本展示，结果由弹窗弹出。
            </blockquote>
            <fieldset class="layui-elem-field layui-field-title">
                <legend>参数输出</legend>
                <div class="layui-field-box">
                    <form class="layui-form layui-form-pane" action="">
                        <div class="layui-form-item">
                            <label class="layui-form-label">模型Tag</label>
                            <div class="layui-input-block">
                                <input type="text" id="model_tag" name="model_tag" autocomplete="off" placeholder="请输入模型Tag值"
                                       class="layui-input">
                            </div>
                        </div>
                        <div id="div_bayes_inner_classify" class="bayes_inner_classify">
                            <div class="layui-form-item div_ready_classify_text">
                                <label class="layui-form-label">待分类文本</label>
                                <div class="layui-input-inline" style="width: 72%">
                                    <input type="text" name="TEXT" lay-verify="title"
                                           autocomplete="off"
                                           placeholder="输入文本"
                                           class="layui-input"/>
                                </div>
                                <div class="layui-input-inline" style="width: 120px">
                                    <div class="layui-btn-group">
                                        <button type='button' id=""
                                                class="layui-btn layui-btn"
                                                onclick='addReadyToClassifyInput("bayes_inner_classify")'>
                                            <i class="layui-icon">&#xe654;</i>
                                        </button>
                                        <button type='button' id=""
                                                class="layui-btn layui-btn-warm layui-btn"
                                                onclick='deleteReadyToClassifyInput("bayes_inner_classify",$(this))'>
                                            <i class="layui-icon">&#xe640;</i>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <button class="layui-btn layui-btn-fluid" type="button" onclick="handonClassify()">执行分析
                </button>
            </fieldset>

            <fieldset class="layui-elem-field layui-field-title">
                <legend>结果输出</legend>
                <div class="layui-field-box">
                    <blockquote class="layui-elem-quote layui-quote-nm"><p class="gray-p">
                    </p>由于内容展示面积较小，又需要展示多文本分类的结果，故结果输出完毕会以个性化弹窗的方式进行可视化渲染。</p>
                    </blockquote>

                </div>
            </fieldset>
        </div>
    </div>
</div>
